<?php

defined('INTERNAL') || die();

require_once __DIR__ . '/lib/system/net/curl.class.php';

/**
 *
 * @copyright (c) 2012 University of Geneva
 * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
 * @author Laurent Opprecht <laurent@opprecht.info>
 */
class PluginArtefactConnect extends PluginArtefact
{

    public static function get_string($identifier, $section = 'artefact.connect')
    {
        return get_string($identifier, $section);
    }

    public static function get_artefact_types()
    {
        return array('connect');
    }

    public static function get_block_types()
    {
        return array();
    }

    public static function get_plugin_name()
    {
        return 'connect';
    }

    public static function menu_items()
    {
        return array();
    }

    public static function get_event_subscriptions()
    {
        return array();
    }

    public static function get_activity_types()
    {
        return array();
    }

    public static function can_be_disabled()
    {
        return true;
    }

    public static function postinst($prevversion)
    {
        
    }

    public static function view_export_extra_artefacts($viewids)
    {
        return array();
    }

    public static function artefact_export_extra_artefacts($artefactids)
    {
        return array();
    }

    public static function get_cron()
    {
        return array();
    }

}

/**
 * Not used. It's only here to avoid installation process to raise an error. 
 
 * @copyright (c) 2012 University of Geneva
 * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
 * @author Laurent Opprecht <laurent@opprecht.info>
 */
class ArtefactTypeConnect extends ArtefactType
{

    public function __construct($id = 0, $data = null)
    {
        parent::__construct($id, $data);
    }

    public static function is_singular()
    {
        return true;
    }

    public static function get_icon($options = null)
    {
        return '';
    }

    public static function get_links($id)
    {
        return array(
            '_default' => get_config('wwwroot'),
        );
    }

    public function can_have_attachments()
    {
        return false;
    }

    public function render_self()
    {
        return '';
    }

    public function exportable()
    {
        return false;
    }

    public function get_view_url($viewid, $showcomment = true, $full = true)
    {
        return get_config('wwwroot');
    }

    public function viewable_in($viewid)
    {
        return false;
    }

    public static function has_config()
    {
        return false;
    }

    public static function get_config_options()
    {
        return array();
    }

    public static function save_config_options($values)
    {
        ;
    }

}
